const router=require('koa-router')();

module.exports=app=>{
    //home
    let homeRouter=require('./home');
    router.use('/',homeRouter.routes(),homeRouter.allowedMethods());

    //reg
    let regRouter=require('./reg');
    router.use('/reg',regRouter.routes(),regRouter.allowedMethods());

    //activate
    let activateRouter=require('./activate');
    router.use('/activate',activateRouter.routes(),activateRouter.allowedMethods());

    //login
    let loginRouter=require('./login');
    router.use('/login',loginRouter.routes(),loginRouter.allowedMethods());

    //logout
    let logoutRouter=require('./logout');
    router.use('/logout',logoutRouter.routes(),logoutRouter.allowedMethods());

    //post
    let postRouter=require('./post');
    router.use('/post',postRouter.routes(),postRouter.allowedMethods());

    //setting
    let settingRouter=require('./setting');
    router.use('/setting',settingRouter.routes(),settingRouter.allowedMethods());

    //article
    let articleRouter=require('./article');
    router.use('/article',articleRouter.routes(),articleRouter.allowedMethods());

    //comment
    let commentRouter=require('./comment');
    router.use('/comment',commentRouter.routes(),commentRouter.allowedMethods());

    //user
    let userRouter=require('./user');
    router.use('/user',userRouter.routes(),userRouter.allowedMethods());

    //users
    let usersRouter=require('./users');
    router.use('/users',usersRouter.routes(),usersRouter.allowedMethods());

    //tags
    let tagsRouter=require('./tags');
    router.use('/tags',tagsRouter.routes(),tagsRouter.allowedMethods());

    //archives
    let archivesRouter=require('./archives');
    router.use('/archives',archivesRouter.routes(),archivesRouter.allowedMethods());

    //notify
    let notifyRouter=require('./notify');
    router.use('/notify',notifyRouter.routes(),notifyRouter.allowedMethods());

    //search
    let searchRouter=require('./search');
    router.use('/search',searchRouter.routes(),searchRouter.allowedMethods());

    //api
    let apiRouter=require('./api');
    router.use('/api/v1',apiRouter.routes(),apiRouter.allowedMethods());

    //mock post data
    let mockRouter=require('./mock');
    router.use('/mock',mockRouter.routes(),mockRouter.allowedMethods());

    //test
    let testRouter=require('./test');
    router.use('/test',testRouter.routes(),testRouter.allowedMethods());

    //install all router
    app.use(router.routes(),router.allowedMethods());
};